const axios = require('axios')
let _baseUrl = '/gateway/images/api'

// 添加镜像
export function createUserImage (data) {
  const url = _baseUrl + '/images/createUserImage'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 查询自定义镜像列表
export function getUserImagesList (data) {
  const url = _baseUrl + '/images/getUserImagesList'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 删除镜像
export function deleteUserImag (data) {
  const url = _baseUrl + '/images/deleteUserImage'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 镜像ID查询用户自定义镜像
export function getUserImageById (data) {
  const url = _baseUrl + '/images/getUserImageById'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 更新镜像简介
export function updateUserImageContent (data) {
  const url = _baseUrl + '/images/updateUserImageContent'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}
